<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<html>
	<head>
	</head>
	<body>
		<form method="post">
			Court Name 
			<input type="text" name="courtName" value="${courtName}" /> 
			<input type="submit" value="Query" />
		</form>
		<table border="1">
		<tr>
			<th>Id</th>
		    <th>Court Name</th>
		    <th>Date</th>
		    <th>Players</th>
		</tr>
		<c:forEach items="${reservations}" var="reservation">
		<tr>
			<td>${reservation.id}</td>
		    <td>${reservation.courtName}</td>
		    <td><fmt:formatDate value="${reservation.time}" pattern="yyyy-MM-dd" /></td>
		    <td>
		    	<c:forEach items="${reservation.personList}" var="person">
		    		${person.name}
		    	</c:forEach>
		    </td>
		</tr>
		</c:forEach>
		</table>
	</body>
</html>